/*
 * Copyright (c) 2019 Wormpex.com. All Rights Reserved.
 */

package com.sk.threadlocal;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * @author ke.su date: 2019-11-14 Time: 上午12:27
 */
public class ThreadLocalTest {
    private final int threadLocalHashCode = nextHashCode();

    public static void main(String[] args) {
        ThreadLocalTest threadLocalTest = new ThreadLocalTest();

        System.out.println(0x61c88647 + 0x61c88647);

        Double d = Math.sqrt(1.25);
        //黄金比例
        System.out.println(d+0.5);

        List<ThreadLocal> threadLocals = new ArrayList<>();


        LinkedList linkedList = new LinkedList<>();
        linkedList.get(1);

        int num = 0;
        for (int i = 0; i < 32; i++) {
            num += 0x61c88647;
            System.out.print((num & 15) + " ");
        }

        for (int i = 0; i < 20; i++) {

            ThreadLocal threadLocal = new ThreadLocal();

            threadLocal.set(i);
            threadLocals.add(threadLocal);
            if (i != 0) {
                threadLocals.get((i - 1)).remove();
            }


        }
    }

    private static int nextHashCode() {
        return 1 + 1;
    }

}
